home *** CD-ROM | disk | FTP | other *** search
/ The Original Shareware 1.1 / The Original Shareware (WeMake CDs)(Volume 1.1)(CDs, Inc)(1993).iso / 8 / fastbak.zip / QUERY.DOC < prev    next >
Text File  |  1986-02-01  |  2KB  |  55 lines

  1. Documentation for QUERY2.COM
  2.  
  3. Author:        Torsten Hoff
  4. Date:        1/25/86
  5. Language:    'C'
  6. Syntax:        QUERY2 valid_choices [message 1 [message 2 ... message n]]
  7. Sample usage:    query2 "123" "Press either 1,2, or 3 "
  8.  
  9. QUERY2 is a program that aids in writing interactive batch files. It takes
  10. a minimum of one command line argument, and returns the ASCII code of the
  11. user response as the DOS ERRORLEVEL.
  12.  
  13. Unlike other programs of this kind, any ASCII code except 0 (Ctrl-@) and 
  14. the Ctrl-Break combination (or Control-C) can be handled, including spaces.
  15.  
  16. Also, returning the ASCII code of the response rather than an index to the
  17. string of choices eliminates the need to edit long batchfiles, since adding
  18. or removing a choice will not change the ERRORLEVEL for any of the other
  19. choices.
  20.  
  21. To include a space in either the string of valid choices, or in a message,
  22. enclose the string in double quotes. For example, the following batchfile
  23. will display a directory of either drive A, B, C, or the current drive:
  24.  
  25. [Listing of SHOWDIR.BAT]
  26.  
  27.    echo off
  28.    cls
  29.    query2 "aAbBcC " "Enter the drive letter you wish a directory of, SPACE for default "
  30.    cls
  31.    if errorlevel 99 goto C
  32.    if errorlevel 98 goto B
  33.    if errorlevel 97 goto A
  34.    if errorlevel 67 goto C
  35.    if errorlevel 66 goto B
  36.    if errorlevel 65 goto A
  37.    if errorlevel 32 goto DEFAULT
  38.    :C
  39.    dir C: /w /p
  40.    goto END
  41.    :B
  42.    dir B: /w /p
  43.    goto END
  44.    :A
  45.    dir A: /w /p
  46.    goto END
  47.    :DEFAULT
  48.    dir /w /p
  49.    :END
  50.    pause
  51.    cls
  52.  
  53.  
  54.  
  55.